{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache('module', 'module');">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
</div>
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="fa fa-cog"></i> {dr_lang('模块设置')} </a>
                </li>
                <li class="{if $page==3}active{/if}">
                    <a href="#tab_3" data-toggle="tab" onclick="$('#dr_page').val('3')"> <i class="fa fa-table"></i> {dr_lang('后台列表显示字段')} </a>
                </li>
                <li class="{if $page==4}active{/if}">
                    <a href="#tab_4" data-toggle="tab" onclick="$('#dr_page').val('4')"> <i class="fa fa-comments"></i> {dr_lang('后台评论显示字段')} </a>
                </li>
            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">

                <div class="tab-pane {if $page==0}active{/if}" id="tab_0">
                    <div class="form-body">
                        {if !$data.share}
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('首页静态化')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[setting][module_index_html]" value="1" {if $data['setting']['module_index_html']}checked{/if} data-on-text="{dr_lang('开启')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <span class="help-block">{dr_lang('开启之后当前模块的首页将会自动生成静态文件')}</span>
                            </div>
                        </div>
                        {/if}
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('同步其他栏目')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[setting][sync_category]" value="1" {if $data['setting']['sync_category']}checked{/if} data-on-text="{dr_lang('开启')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <span class="help-block">{dr_lang('将内容同步发布到其他的栏目之中')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('后台默认排序')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control input-xlarge" type="text" name="data[setting][order]" value="{if $data['setting']['order']}{$data['setting']['order']}{else}displayorder DESC,updatetime DESC{/if}" ></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('拒绝审核理由')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control" style="height:200px; width:100%;" name="data[setting][verify_msg]">{$data['setting']['verify_msg']}</textarea>
                                <span class="help-block">{dr_lang('常用的拒绝审核理由，一行一个')}</span>
                            </div>
                        </div>
                    </div>
                </div>



                <div class="tab-pane {if $page==3}active{/if}" id="tab_3">
                    <div class="form-body">
                        {loop $field $n $t}
                        <div class="form-group field-{$n}">
                            <label class="col-md-2 control-label">{dr_lang($t.name)} ({$t.fieldname})</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio">
                                        <input type="radio" onclick="dr_field_show('{$n}', 1)" name="data[setting][list_field][{$t.fieldname}][use]" value="1" {if $data['setting']['list_field'][$t.fieldname]['use']} checked{/if} > {dr_lang('显示')}
                                        <span></span>
                                    </label>
                                    <label class="mt-radio">
                                        <input type="radio" onclick="dr_field_show('{$n}', 0)" name="data[setting][list_field][{$t.fieldname}][use]" value="0" {if !$data['setting']['list_field'][$t.fieldname]['use']} checked{/if}> {dr_lang('隐藏')}
                                        <span></span>
                                    </label>
                                </div>
                                <div class="list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:layer.msg('{dr_lang('排列顺序值由小到大')}');">{dr_lang('序列')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][list_field][{$t.fieldname}][order]" value="{php echo $data['setting']['list_field'][$t.fieldname]['order'] ? $data['setting']['list_field'][$t.fieldname]['order'] : $n+100}" />
                                    </div>
                                </div>
                                <div class="list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:layer.msg('{dr_lang('列表的显示名称')}');">{dr_lang('名称')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][list_field][{$t.fieldname}][name]" value="{php echo $data['setting']['list_field'][$t.fieldname]['name'] ? $data['setting']['list_field'][$t.fieldname]['name'] : $t.name}" />
                                    </div>
                                </div>
                                <div class="list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:layer.msg('{dr_lang('不填宽度表示自动宽度')}');">{dr_lang('宽度')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][list_field][{$t.fieldname}][width]" value="{$data['setting']['list_field'][$t.fieldname]['width']}" />
                                    </div>
                                </div>
                                <div class="list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:dr_call_alert();">{dr_lang('回调')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][list_field][{$t.fieldname}][func]" value="{$data['setting']['list_field'][$t.fieldname]['func']}" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <script>
                            $(function() {
                                dr_field_show('{$n}', {intval($data['setting']['list_field'][$t.fieldname]['use'])});
                            });
                        </script>
                        {/loop}
                    </div>
                </div>


                <div class="tab-pane {if $page==4}active{/if}" id="tab_4">
                    <div class="form-body">
                        {loop $comment_field $n $t}
                        <div class="form-group comment-field-{$n}">
                            <label class="col-md-2 control-label">{dr_lang($t.name)} ({$t.fieldname})</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio">
                                        <input type="radio" onclick="dr_field_show_comment('{$n}', 1)" name="data[setting][comment_list_field][{$t.fieldname}][use]" value="1" {if $data['setting']['comment_list_field'][$t.fieldname]['use']} checked{/if} > {dr_lang('显示')}
                                        <span></span>
                                    </label>
                                    <label class="mt-radio">
                                        <input type="radio" onclick="dr_field_show_comment('{$n}', 0)" name="data[setting][comment_list_field][{$t.fieldname}][use]" value="0" {if !$data['setting']['comment_list_field'][$t.fieldname]['use']} checked{/if}> {dr_lang('隐藏')}
                                        <span></span>
                                    </label>
                                </div>
                                <div class="comment-list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:layer.msg('{dr_lang('排列顺序值由小到大')}');">{dr_lang('序列')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][comment_list_field][{$t.fieldname}][order]" value="{php echo $data['setting']['comment_list_field'][$t.fieldname]['order'] ? $data['setting']['comment_list_field'][$t.fieldname]['order'] : $n+100}" />
                                    </div>
                                </div>
                                <div class="comment-list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:layer.msg('{dr_lang('列表的显示名称')}');">{dr_lang('名称')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][comment_list_field][{$t.fieldname}][name]" value="{php echo $data['setting']['comment_list_field'][$t.fieldname]['name'] ? $data['setting']['comment_list_field'][$t.fieldname]['name'] : $t.name}" />
                                    </div>
                                </div>
                                <div class="comment-list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:layer.msg('{dr_lang('不填宽度表示自动宽度')}');">{dr_lang('宽度')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][comment_list_field][{$t.fieldname}][width]" value="{$data['setting']['comment_list_field'][$t.fieldname]['width']}" />
                                    </div>
                                </div>
                                <div class="comment-list-field-cog">
                                    <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:dr_call_alert();">{dr_lang('回调')}</a>
                                        </span>
                                        <input class="form-control" type="text" name="data[setting][comment_list_field][{$t.fieldname}][func]" value="{$data['setting']['comment_list_field'][$t.fieldname]['func']}" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <script>
                            $(function() {
                                dr_field_show_comment('{$n}', {intval($data['setting']['comment_list_field'][$t.fieldname]['use'])});
                            });
                        </script>
                        {/loop}
                    </div>
                </div>


            </div>
        </div>
    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>
<script type="text/javascript">
    $(function() {
        dr_theme({$is_theme});
    });
    function dr_field_show(n, u) {
        if (u) {
            $('.field-'+n+' .list-field-cog').show();
        } else {
            $('.field-'+n+' .list-field-cog').hide();
        }
    }
    function dr_field_show_comment(n, u) {
        if (u) {
            $('.comment-field-'+n+' .comment-list-field-cog').show();
        } else {
            $('.comment-field-'+n+' .comment-list-field-cog').hide();
        }
    }
    function dr_theme(id) {
        if (id == 1) {
            $("#dr_theme_html").html($("#dr_web").html());
        } else {
            $("#dr_theme_html").html($("#dr_local").html());
        }
    }
</script>
<div id="dr_local" style="display: none">
    <label class="col-md-2 control-label">{dr_lang('主题风格')}</label>
    <div class="col-md-9">
        <label><select class="form-control" name="site[theme]">
            <option value="default"> -- </option>
            {loop $theme $t}
            <option{if $t==$site['theme']} selected=""{/if} value="{$t}">{$t}</option>
            {/loop}
        </select></label>
        <span class="help-block">{dr_lang('位于网站主站根目录下：/static/风格名称/')}</span>
    </div>
</div>
<div id="dr_web" style="display: none">
    <label class="col-md-2 control-label">{dr_lang('远程资源')}</label>
    <div class="col-md-9">
        <input class="form-control  input-xlarge" type="text" placeholder="http://" name="site[theme]" value="{php echo strpos($site['theme'], 'http') === 0 ? $site['theme'] : '';}">
        <span class="help-block">{dr_lang('网站将调用此地址的css,js,图片等静态资源')}</span>
    </div>
</div>
{template "footer.html"}